import { ContributionCalendar } from 'configs/contributionsCollection';

export type ContributionsCollectionApi = {
    data: {
        user: {
            contributionsCollection: {
                contributionYears: number[];
                contributionCalendar: ContributionCalendar;
            };
        };
    };
};

export type ContributionsCollectionModel = {
    contributionYears: number[];
    contributionCalendar: ContributionCalendar;
};

export const normalizeContributionsCollection = (from: ContributionsCollectionApi): ContributionsCollectionModel =>
    from.data.user.contributionsCollection;
